{% extends "site_base.html" %}
{% block body %}
	<div id="page-container">
		  {% for egz in katalog %}
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                        <span class="box-header-title">
                                            <img class="box-header-pointer" alt="pointer" src="{{ MEDIA_URL }}css/gfx/icons/point-transparent.png" />
                                            <span>{{ egz.ksiazka.tytul }} - {{ egz.isbn }}</span>
                                        </span>
                                    </div>
				    {% if egz.dostepny %}
                                    <div class="box-content">
					<div class="text"><strong>dostępna</strong></div>
					<hr/>
                                        <div class="line">
					     <span class="button-border"><span class="date alert"></span></span>
                                            <form method="POST" action=".">
                                                <fieldset>
                                                       <span class="right">
							   <input type=hidden name="isbn" value ="{{ egz.isbn }}">
                                                           <span class="button-border"><input type="submit"  value="wypożycz"> </span>
                                                      </span>
                                                </fieldset>
                                            </form>
					    </p>
                                       </div>       
                                    </div>
				    {% else %}
					<div class="box-content">
					<div class="text"><strong>niedostępna</strong></div>
					<hr/>
                                        <div class="line">
					    <span class="button-border"><span class="date alert">{{ egz.dataZwrotu }}</span></span>
                                            <span class="content">
                                                <p><strong>przewidywana data zwrotu </strong></p>
                                            </span>
                                       </div>       
                                    </div>
				    {% endif %}
                                </div>
                            </div>
	          {% endfor %}
 	</div>
	<div id="page-container-2">
                        <!-- Prawa kolumna START -->
                            <!-- Autor -->
                            <div class="box-shadow">
                                <div class="box">
                                    <div class="box-header">
                                        <span class="box-header-title">
                                            <img class="box-header-pointer" alt="pointer" src="{{ MEDIA_URL }}css/gfx/icons/point-transparent.png" />
                                            <span>Stan Konta</span>
                                        </span>
                                    </div>
                                    <div class="box-content">
                                        <p class="author">
                                            <span class="avatar">
                                                <img alt="" src="{{ MEDIA_URL }}css/gfx/icons/no-foto-normal.gif" />
                                            </span>
                                            <span class="data">
                                                <strong>{{ user.first_name }} {{ user.last_name }}</strong><br />
                                            </span>
                                            <span class="icons">
                                                <span class="color-gray">@</span><span class="color-orange">online</span><br />
                                                <img alt="" src="{{ MEDIA_URL }}css/gfx/icons/plus-white.gif" /><img alt="" src="{{ MEDIA_URL }}css/gfx/icons/show-white-2.gif" /><img alt="" src="{{ MEDIA_URL }}css/gfx/icons/message-white.gif" />
                                            </span>
                                        </p>
                                        <hr />
                                        <p class="last-posts">
                                            <strong>Ostatnio wypożyczone książki: </strong><br />
					     {% for ithem in egz %}
                                             <p class="half-line">
                                            	<span class="content strong tag-normal"> » {{ithem.ksiazka.tytul }} </span>
					 	{% if ithem.ksiazkaOdebrana %}
                                                <span class="color-gray positions"> zwrot: {{ ithem.dataZwrotu }}</span>
						{% else %}
						 <span class="color-gray positions">nieodebrana</span>
						{% endif %}
                                             </p>
                                             <hr />  
					     {% endfor %}
                                        </p>
                                    </div>
                                </div>
                            </div>
                            <!-- Autor KONIEC -->
{% endblock %}
